home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4096 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: news.mira.net.au!usenet
  2. From: Ross Forder <erosco@werple.mira.net.au>
  3. Newsgroups: comp.lang.c++
  4. Subject: Two way communication between objects
  5. Date: Sun, 28 Jan 1996 11:09:54 +1000
  6. Organization: Werple Internet, Melbourne
  7. Message-ID: <310ACCE2.2600@werple.mira.net.au>
  8. NNTP-Posting-Host: dp-m-a19.werple.mira.net.au
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b3 (Win95; I)
  13.  
  14. I have to apologise what what is probably a stupid question but I'm only
  15. a beginner at some of this stuff.
  16.  
  17. I am trying to write a VERY simple client and server set of objects. I 
  18. would like to client to register with the server at ctor time and have 
  19. the server know about the client by saving a pointer to the client 
  20. so he can callback to a method called say 'event'. 
  21.  
  22. The problem is the fact that they will both need a pointer to each other 
  23. and this seems impossible using strong typing. Is there a simple 'object 
  24. oriented' way to do this?
  25.  
  26. I have been able to make this work by having the server only know about 
  27. a parent class of the client (say eventhandler) but this is still not a 
  28. bulletproof solution.
  29.  
  30. Can someone set me straight?
  31.  
  32. Thanks
  33. Ross Forder
  34.